#include "BaseAntiCheatPlugin.h"
#include "Log.h"
#include "Expand/PluginsManager.h"
#include "Managers/GameManager.h"
#include "Managers/ComponentsManager.h"

#include "ComponentAntiCheatBase.h"

#include "GameSingleton.h"

namespace PocketSurvival
{
    BaseAntiCheatPlugin::BaseAntiCheatPlugin() {}

    const std::string &BaseAntiCheatPlugin::getPluginName()
    {
        static const std::string pluginName = "反作弊插件";
        return pluginName;
    }

    const std::string &BaseAntiCheatPlugin::getIntroduce()
    {
        static const std::string introduce = "这只是一个反作弊插件";
        return introduce;
    }

    uint32_t BaseAntiCheatPlugin::getUseAuthLevel()
    {
        return 100;
    }

    AuthDisplayType BaseAntiCheatPlugin::getDisplayType()
    {
        return AuthDisplayType::Authority;
    }

    void BaseAntiCheatPlugin::processCmd(ChatObj &chatObj, std::vector<std::string> &cmdDataVec) {}

    void BaseAntiCheatPlugin::load()
    {
        GameSingleton::componentsManager->replcaeOrEmplaceComponent<ComponentAntiCheat, ComponentAntiCheatBase>();
    }

} // namespace PocketSurvival


using namespace PocketSurvival;

extern "C" void initialize()
{
    GameSingleton::pluginsManager->registerPlugin<BaseAntiCheatPlugin>();
    Log::Info("成功加载 BaseAntiCheatPlugin 插件");
}